package leetcode.view0102;

public class Solution {
	public boolean CheckPermutation(String s1, String s2) {
		if (s1.length() != s2.length()) {
			return false;
		}
		int[] h = new int[128];
		for (int i = 0; i < s1.length(); i++) {
			h[s1.charAt(i)]++;
			h[s2.charAt(i)]--;
		}
		for (int i = 0; i < h.length; i++) {
			if (h[i] != 0)
				return false;
		}
		return true;
	}
}
